package com.mcintyret.site.config;

import com.mcintyret.site.journal.database.JournalDatabaseConfig;
import com.mcintyret.site.security.SecurityConfig;
import com.mcintyret.site.users.database.UsersDatabaseConfig;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * User: mcintyret2
 * Date: 28/03/2012
 */

@Configuration
@ComponentScan(basePackages = "com.mcintyret.site",
               excludeFilters = {@ComponentScan.Filter(Controller.class),
                                @ComponentScan.Filter(Configuration.class)})
@PropertySource({"classpath:application.properties", "classpath:database.properties", "classpath:local-properties.properties"})
@Import({JournalDatabaseConfig.class, UsersDatabaseConfig.class, SecurityConfig.class})
@EnableTransactionManagement(proxyTargetClass = true)
public class RootAppContextConfig {

    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }

}
